package com.onpositive.mediawiki.serializing;

import java.io.DataOutputStream;
import java.io.IOException;
import java.util.ArrayList;

import com.onpositive.data.serializer.writers.StringIterableWriter;
import com.onpositive.units.ParsedFileList;

public class FileListWriter extends AbstractMediaWikiWriter<ParsedFileList> {

	StringIterableWriter siw = new StringIterableWriter() ;
	
	public FileListWriter()
	{
		super(ParsedFileList.class);
	}

	@Override
	public void append(ParsedFileList obj)
	{
		@SuppressWarnings("unchecked")
		ArrayList<String> strArr = obj != null ? (ArrayList<String>)obj.value() : null ;
		siw.append(strArr);
	}

	@Override
	public void serialize(DataOutputStream stream) throws IOException
	{
		siw.serialize( stream ) ;
	}
}
